using AppToolKit.Model.i18n;
using System;
namespace AppToolKit.Model.Validation.Validator
{
	public class RequireRuleValidator : DefalutValidator
	{
		public override ValidateResult Validate(ValidateContext context)
		{
			return this.StringReqiure(context);
		}
		private ValidateResult StringReqiure(ValidateContext context)
		{
			ValidateResult result;
			if (context.NewValue == null || context.NewValue.ToString() == string.Empty)
			{
				result = ValidateResult.Error(string.Format(StringResource.RequireValidateMessage, context.PropertyDescript));
			}
			else
			{
				result = null;
			}
			return result;
		}
	}
}
